dofile ("libRadioButton.lua")

rb1 = "RadioButton 1.1/RadioButton 1.2/RadioButton 1.3"
rb2 = "RadioButton 2.1/RadioButton 2.2/RadioButton 2.3"

RadioButton.init (1, 5, 5, rb1)
RadioButton.init (2, 125, 5, rb2)

while not Keys.newPress.Start do
   
  Controls.read()
  
  startDrawing()
    
    RadioButton.draw (1)
    RadioButton.draw (2)
    RadioButton.draw (3)
    RadioButton.draw (4)
    
    if RadioButton.selected (1, 1) then
      screen.print (SCREEN_UP, 5, 5, "RadioButton 1.1 selected")
    elseif RadioButton.selected (1, 2) then
      screen.print (SCREEN_UP, 5, 5, "RadioButton 1.2 selected")
    elseif RadioButton.selected (1, 2) then
      screen.print (SCREEN_UP, 5, 5, "RadioButton 1.3 selected")
    end
    
    if RadioButton.selected (2, 1) then
      screen.print (SCREEN_UP, 5, 5, "RadioButton 2.1 selected")
    elseif RadioButton.selected (2, 2) then
      screen.print (SCREEN_UP, 5, 5, "RadioButton 2.2 selected")
    elseif RadioButton.selected (2, 2) then
      screen.print (SCREEN_UP, 5, 5, "RadioButton 2.3 selected")
    end
    
  stopDrawing()

end

RadioButton.clear (1)
RadioButton.clear (2)
RadioButton.clear (3)
RadioButton.clear (4)

